//
//  protocol.swift
//  SetAndMap
//
//  Created by lhc on 2024/7/20.
//

import Foundation


protocol MySet {
    associatedtype E where E: Comparable
    func getSize() -> Int
    func isEmpty() -> Bool
    func add(element: E)
    func contains(_ element: E) -> Bool
    func removeElement(_ element: E)
}


protocol MyMap {
    associatedtype K where K: Comparable
    associatedtype V
    func getSize() -> Int
    func isEmpty() -> Bool
    func getValueBy(key: K) -> V?
    func setValueBy(key: K, value: V)
    func remove(key: K) -> V?
}





